<div ng-include="'components/navbar/navbar.html'"></div>

<div class="container">
  <div class="row">
    <div class="col-sm-12">
      <h1>修改密码</h1>
    </div>
    <div class="col-sm-12">
      <form class="form" name="form" ng-submit="changePassword(form)" novalidate>

        <div class="form-group">
          <label>当前密码</label>

          <input type="password" name="password" class="form-control" ng-model="user.oldPassword"
                 mongoose-error/>
          <p class="help-block" ng-show="form.password.$error.mongoose">
              {{ errors.other }}
          </p>
        </div>

        <div class="form-group">
          <label>新密码</label>

          <input type="password" name="newPassword" class="form-control" ng-model="user.newPassword"
                 ng-minlength="3"
                 required/>
          <p class="help-block"
             ng-show="(form.newPassword.$error.minlength || form.newPassword.$error.required) && (form.newPassword.$dirty || submitted)">
            Password must be at least 3 characters.
          </p>
        </div>

        <p class="help-block"> {{ message }} </p>

        <button class="btn btn-primary" type="submit">Save changes</button>
      </form>
    </div>
  </div>
</div>
